package com.homedo.odin.solution.service.bizservice.wap;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.homedo.core.common.util.BeanUtils;
import com.homedo.odin.solution.contract.wap.SolutionDownloadsResp;
import com.homedo.odin.solution.enumcode.basic.DownloadCollectEnum;
import com.homedo.odin.solution.model.dto.SolutionDownloadResponseBean;
import com.homedo.odin.solution.service.UserSolutionServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: zhaoxudong
 * @date: 2018/3/29 15:16
 * @Description:
 */
@Service
public class WapDownloadsBizService {

    @Autowired
    UserSolutionServiceImpl userSolutionService;

    public SolutionDownloadsResp solutions(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        PageInfo<SolutionDownloadResponseBean> pageInfo = new PageInfo<>(
                userSolutionService.solutions(DownloadCollectEnum.DOWNLOAD.getDbValue()));
        return BeanUtils.transfrom(SolutionDownloadsResp.class, pageInfo);
    }
}
